using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;

public class PhoneMagnifier : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
    private Vector3 mousePosition;
    
    public void OnPointerDown(PointerEventData pointerEventData)
    {
        if (!NPCManager.instance.isInAskMode)
        {
            mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
            mousePosition.z = 0;
            UIManager.instance.PhoneMagnified.GetComponent<RectTransform>().position = mousePosition;
            UIManager.instance.PhoneMagnified.SetActive(true);
        }

    }
    
    public void OnPointerUp(PointerEventData pointerEventData)
    {
        UIManager.instance.PhoneMagnified.SetActive(false);
    }
}
